Explanation: mutual conversion of binary, octal, decimal, and hexadecimal values: in addition to the remainder of 2, the integers are arranged in reverse order, that is, each time an integer is divided by 2, and the remainder is the number on the
Computer Basics: Binary, octal, decimal, hex 2006-11-29 20:23
one or 10 binary number The decimal number is the most widely used counting system in daily life. The symbols that make up the decimal number have a total of 10 symbols such
Popular usage: each bit of binary represents a State.
001,010,100 indicates three states.
Through or | operations, you can combine various States.
001 | 010 = 011
001 | 010 | 100 = 111
You can remove a certain State through and & Operations.111 & 00
1) Number SystemBinary is used in computers, because binary is easy to operate, easy to implement, and reliable, it provides a favorable way for logical design and saves devices. In order to facilitate the description, it is also commonly used for
1. Convert decimal to binary
To convert decimal to binary, You need to convert the integer part and the decimal part. The integer is divided by 2, and the quotient is divided by 2. After obtaining 0, you can sort the remainder in reverse order.
The
(1) the basic concept of the carry-in counting system sorts numeric symbols into digits in order, and counts them in a way from low to high, it is called the carry counting system. For example, we usually use the decimal system, which is short for
Popular usage: Each digit of the binary represents a state.
001,010,100 This means three states.
You can combine various states by or | operations.
001|010=011
001|010|100=111
A state can be removed by the operation of the &.
111&001=110
You can
Number of hexadecimal values: char * sum (int n, char * num1, char * num2)
Function:
The first parameter n represents the number of hexadecimal values. The maximum value is 36, from 0 to 9, and then A to Z represents 10 to 35.
Char * num1 and char *
99: the binary value is 1100011, The octal value is 143, and The hexadecimal value is 63.113: 110001 161 71127: 100100111 447 127192: 11000000 300 C0324: 101000100 504 144
Algorithm:
Mutual Algorithm for decimal and Binary ConversionConvert
Program apes may be unfamiliar with binary systems, which are widely used in computing technology. Binary data is a number represented by 0 and 12 digits. But many people will convert binary to integers, but how do you represent negative numbers in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.